const Router = require("@koa/router");
const categoryController = require("../controllers/categoryController");

const router = new Router();

// 获取所有分类
router.get("/category", categoryController.getAllCategories);

// 获取单个分类通过id
router.get("/category/:id", categoryController.getCategoryById);

// 创建新的分类
router.post("/category", categoryController.createCategory);

// 更新分类
router.put("/category/:id", categoryController.updateCategory);

// 删除分类
router.delete("/category/:id", categoryController.deleteCategory);

module.exports = router;
